<template>
  <div class="text">
    <svg class="icon" aria-hidden="true" v-if="code!='el-icon-picture'">
      <use :xlink:href="iconFont"></use>
    </svg>
    <i class="el-icon-picture-outline"  style="font-size: 18px;color: #43c9a8" v-if="code==='el-icon-picture'"></i>
    <span> {{text}}</span>

  </div>
</template>
<script>
  export default {
    name:'icon',
    props:['code','text'],
    computed: {
      iconFont(){
        return '#icon-'+this.code;
      }
    }
  }
</script>
<style scoped lang="scss">
.icon{
  width:20px;
  height:20px;
  vertical-align:-5px;
  fill:#43c9a8;
}
.text{
  display: flex;
  align-items: center;
  margin-top: 1px;
span{
  margin-left: 8px;
}
}
</style>